package com.objetdirect.gwt.umldrawer.client;

import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;

public class TermsOfUsePage implements PageContent {

	private VerticalPanel mainPanel = new VerticalPanel();
	private VerticalPanel termsContent = new VerticalPanel();
	private Label termsLabel = new Label();
	private Label statementOfRights = new Label();
	private Label privacyHeader = new Label();
	private Label sharingHeader = new Label();
	private Label safetyHeader = new Label();
	private Label registerationHeader = new Label();
	private Image header = new Image();
	private Image footer = new Image();
	
	@Override
	public void setPageContent() {
		header.setUrl("images/header.png");
		header.setWidth("1201px");
		header.setStyleName("headerImage");
		
		termsLabel.setText("Terms Of Use");
		termsLabel.setStyleName("pagesHeader");
		
		String intro = "<div class='termsIntro'>This agreement was written in English (US). " +
				"To the extent any translated version of this " +
				"agreement conflicts with the English version, " +
				"the English version controls." +
				"<br>Date of Last Revision: November 27, 2010.<div>";
		
		statementOfRights.setText("Statement of Rights and Responsibilities");
		statementOfRights.setStyleName("termStatement");
		
		String statementIntro = "<div class='termsIntro'>This Statement of Rights and Responsibilities" +
				" (Statement) derives from the ProDesUML Principles, and governs" +
				" our relationship with users and others who interact with ProDesUML. " +
				"By using or accessing ProDesUML, you agree to this Statement.<div>";
		
		privacyHeader.setText("1. Privacy");
		privacyHeader.setStyleName("termsHeader");
		
		String privacyText = "<div class='termsPoints'>Your privacy is very important to us. " +
				"We designed our Privacy Policy to make important " +
				"disclosures about how you can use ProDesUML to share " +
				"with others.  We encourage you to read the Privacy Policy, " +
				"and to use it to help make informed decisions.<div>";
		
		sharingHeader.setText("2. Sharing Your Projects");
		sharingHeader.setStyleName("termsHeader");
		
		String sharingText = "<div class='termsPoints'>You own all of the content and projects you post " +
				"on ProDesUML and you can control how it is shared through your " +
				"privacy and application settings. In addition:" +
				"<br><br><b>1.</b>	For content that is covered by intellectual " +
				"property rights, like your projects, you specifically " +
				"give us the following permission, subject to your privacy " +
				"andapplication settings: you grant us a non-exclusive, transferable," +
				" sub-licensable, royalty-free, worldwide license to use any IP content" +
				" that you post on or in connection with ProDesUML. " +
				"<br><b>2.</b>	When you use an application, your content and projects is shared with the application.  " +
				"We require applications to respect your privacy, and your agreement with that application " +
				"will control how the application can use, store, and transfer that content and projects."+
				"<br><b>3.</b>	We always appreciate your feedback or other suggestions about ProDesUML, but you " +
				"understand that we may use them without any obligation to compensate you for them " +
				"(just as you have no obligation to offer them.<div>";
		
		safetyHeader.setText("3. Safety");
		safetyHeader.setStyleName("termsHeader");
		
		String safetyText = "<div class='termsPoints'>We do our best to keep ProDesUML safe, but we cannot guarantee it. " +
				"We need your help to do that, which includes the following commitments: " +
				"<br><br><b>1.</b>	You will not upload viruses or other malicious code." +
				"<br><b>2.</b>	You will not solicit login information or access an account belonging to someone else." +
				"<br><b>3.</b>	You will not bully, intimidate, or harass any user." +
				"<br><b>4.</b>	You will not post content that: is hateful, threatening, " +
				"or pornographic; incites violence; or contains nudity or graphic or gratuitous violence." +
				"<br><b>5.</b>	You will not use ProDesUML to do anything unlawful, misleading, malicious, or discriminatory." +
				"<br><b>6.</b>	You will not do anything that could disable, overburden, " +
				"or impair the proper working of ProDesUML, such as a denial of service attack." +
				"<br><b>7.</b>	You will not facilitate or encourage any violations of this Statement.<div>";
		
		registerationHeader.setText("4.	Registration and Account Security");
		registerationHeader.setStyleName("termsHeader");
		
		String registrationText = "<div class='termsPoints'>ProDesUML users provide their real names and information, " +
				"and we need your help to keep it that way. Here are some commitments you make " +
				"to us relating to registering and maintaining the security of your account:" +
				"<br><br><b>1.</b>	You will not provide any false personal information on ProDesUML, or create " +
				"an account for anyone other than yourself without permission." +
				"<br><b>2.</b>	You will not create more than one personal profile." +
				"<br><b>3.</b>	If we disable your account, you will not create another one without our permission." +
				"<br><b>4.</b>	You will not use ProDesUML if you are under 13." +
				"<br><b>5.</b>	You will not use ProDesUML if you are a programmer." +
				"<br><b>6.</b>	You will keep your contact information accurate and up-to-date." +
				"<br><b>7.</b>	You will not share your password, (or in the case of developers, " +
				"your secret key), let anyone else access your account, or do anything " +
				"else that might jeopardize the security of your account." +
				"<br><b>8.</b>	You will not transfer your account (including any page or application" +
				" you administer) to anyone without first getting our written permission.<div>";
		
		footer.setUrl("images/footer.png");
		footer.setWidth("1201px");
		
		mainPanel.setWidth("1150px");
		
		termsContent.add(new HeaderButtons().getHeaderButtons());
		termsContent.add(termsLabel);
		termsContent.add(new HTML(intro));
		termsContent.add(statementOfRights);
		termsContent.add(new HTML(statementIntro));
		termsContent.add(privacyHeader);
		termsContent.add(new HTML(privacyText));
		termsContent.add(sharingHeader);
		termsContent.add(new HTML(sharingText));
		termsContent.add(safetyHeader);
		termsContent.add(new HTML(safetyText));
		termsContent.add(registerationHeader);
		termsContent.add(new HTML(registrationText));
		termsContent.add(new PrivacyBar().getprivacyBar());
		
		termsContent.setStyleName("border");
		
		mainPanel.add(header);
		mainPanel.add(termsContent);
		mainPanel.add(footer);
	}

	@Override
	public VerticalPanel getPageContent() {
		setPageContent();	
		return mainPanel;
	}

	
}
